import { baseUrlApi, requestClient, type Result } from '#/api/request';

/** 获取列表 */
export const getPage_news = (params?: object) => {
  return requestClient.get<Result>(baseUrlApi('/portal/admin/vechilebanner'), {
    params,
  });
};

/** 添加 */
export const postPage_news = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/vechilebanner'), data);
};

/** 获取信息 */
export const getPageInfo_news = (data: { id: number }) => {
  return requestClient.get<Result>(baseUrlApi(`/portal/admin/vechilebanner/${data.id}`));
};


export const getPageInfo_news_car= (data: { car_model: number }) => {
  return requestClient.get<Result>(baseUrlApi(`/portal/admin/vechilebanner/${data.car_model}`));
};
/** 编辑 */
export const putPage_news = (data?: any) => {
  return requestClient.put<Result>(
    baseUrlApi(`/portal/admin/vechilebanner/${data.id}`),
    data,
  );
};

/** 删除 */
export const deletePage_news = (id: number) => {
  return requestClient.delete<Result>(baseUrlApi(`/portal/admin/vechilebanner/${id}`));
};


